Skip to content

Input method and virtual keyboard#93

Draft
rano-oss wants to merge 119 commits intopop-os:masterfrom
rano-oss:input_method_and_virtual_keyboard
Draft

Input method and virtual keyboard#93
rano-oss wants to merge 119 commits intopop-os:masterfrom
rano-oss:input_method_and_virtual_keyboard

Conversation

@rano-oss
Copy link
Copy Markdown

@rano-oss rano-oss commented Dec 25, 2023

Adds input method client support to make input methods. Input method support is enabled with a flag and will grab the keyboard. Current protocol also needs virtual keyboard to make a complete input method, therefore support for this is also added.

use super::input_method::keyboard::RawModifiers;

#[derive(Debug)]
pub struct VirtualKeyboardManager<T> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would make sense to provide a simple helper for the virtual keyboard protocol in smithay-client-toolkit. Though it's not too complicated of a protocol.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Virtual keyboard is really small and kind of niche, maybe it would make more sense a library/crate that can be used with sctk?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be an idea to move a lot of the boilerplate code to its own crate, niche_sctk or something like that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I don't see an issue with having fairly niche things (that are commonly supported standard Wayland protocols) in sctk. As long as they don't significantly increase build time (then they could have feature flags) or distract too much from the more widely used parts of the crate. I don't know what others think about that though.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make a pr for both and see what happens :)

@ids1024
Copy link
Copy Markdown
Member

ids1024 commented Dec 25, 2023

This should be useful if we want to create an on screen keyboard for Cosmic. Input-method + layer-shell seems to be the standard approach for that on Wayland.

wash2 and others added 28 commits January 23, 2024 21:24
feat: stable ids

a11y: Don't unconditionally pull winit (pop-os#43)
fix: quad rendering including border only inside of the bounds

fix: better slider drawing (it allows just the border part of the handle quad outside of the layout bouds, which isn't great, but is ok for our purposes due to being transparent)

cleanup: fix & format

fix: use iced_core::Font

cleanup

fix: allow leaving out winit & iced-sctk

fix: settings

fix: slider draw improvements

fix: websocket example

fix: modal example

fix: scrollable example

fix: toast example

fix: avoid panicking in iced_sctk with lazy widgets in auto-size surfaces

fix: todos panic

fix: only diff auto-sized surfaces in iced_sctk build_user_interface & improve sctk examples

wip (iced-sctk): window resize with icons

feat (iced-sctk): support for setting cursor

refactor: default decorations to client

fix: set window geometry after receiving configure

fix: size limits with no max bound must be cut off

fix: send size update when autosized surface resizes

fix: use ceil size for positioner

cleanup: remove dbg statement

fix: remove a destroyed surface from compositor surfaces

fix errors after rebase and wip scaling support

fix: handling of scale factor in set_logical_size

fix (sctk_drag example): add .into for border radius

fix: fractional scaling

sctk: Fire RedrawRequests

wip: animations via frame event

fix / refactor iced-sctk redraw & frame event handling

cleanup: note about frame request in iced-sctk

fix: send resize when necessary for layer surface and popups too

fix: always request redraw for a new surface

fix: scaling and autosize surface improvements

refactor: sctk_lazy keyboard interactivity

feat(sctk): configurable natural_scroll property

feat: send state and capabilities events when there are changes

fix: redraw when an update is needed and clean up the logic

Update sctk to latest commit

Fix compilation of sctk drag example

fix(sctk): update interface before checking if it has a redraw request

refactor: after autosize surface resize wait to redraw until the resize has been applied

refactor: better handling of autosize surfaces

chore: update sctk

chore: update sctk

fixes sctk_drag example

fix: default to ControlFlow::Wait for applications with no surface

this seems to help CPU usage for app library and launcher

default to 250ms timeout in the event loop

Update sctk

sctk: Implement xdg-activation support

fix: don't require Flags to be clone for settings on wayland

chore: error if neither winit or wayland feature is set

chore: Allow compiling without windowing system (pop-os#65)

fix(iced-sctk): handle exit_on_close_request

fix: make sure that each widget operation operates on every interface

This should be ok even for widget actions like focus next because there can only ever be a single focused widget

cargo fmt

cleanup: dbg statement

fix(iced-sctk): replace panic with handling for remaining enum variants

refactor: use iced clipboard for interacting with the selection

refactor: allow passing an activation token when creating a window

sctk: Add support for `ext-session-lock` protocol

fix(sctk): build and use tree for layout of autosize surfaces

Update winit to latest commit used by upstream iced

fix(sctk): send key characters

fix(sctk): check if key is a named key first

refactor(sctk): keep compositor surface in state
Co-Authored-By: Austin M. Reppert <austinmreppert@gmail.com>
By default, this is the same as the text color for best visibility.
Part of this is a refactor of the ID

cleanup: clippy and fmt

fix: test workflow

fix: add note in CHANGELOG

fix: clippy
ids1024 and others added 25 commits February 28, 2024 07:53
Useful for testing pointer input to subsurfaces.
when broadcasting events for no specific surface, it should be done after update so that the runtime subscription is current
A null `region` represents an infinite region (the default). To set an
empty region, we need to create a `wl_region`.
@wash2 wash2 force-pushed the master branch 2 times, most recently from 6115280 to 79e74f5 Compare October 18, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.